package com.hadwinling.blog.service.impl;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.hadwinling.blog.entity.Admin;
import com.hadwinling.blog.mapper.AdminMapper;
import com.hadwinling.blog.service.AdminService;

import java.util.List;

/**
 * @author HadwinLing
 * @version V1.0
 * @Package com.hadwinling.blog.service.impl
 * @date 2020/8/19 8:12
 */
@Service
public class AdminServiceImpl implements AdminService {

    @Resource
    private AdminMapper adminMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return adminMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Admin record) {
        return adminMapper.insert(record);
    }

    @Override
    public int insertSelective(Admin record) {
        return adminMapper.insertSelective(record);
    }

    @Override
    public Admin selectByPrimaryKey(Integer id) {
        return adminMapper.selectByPrimaryKey(id);
    }

    @Override
    public Admin selectOneByAdminnameAndPasswordAndState(String adminname, String password, int state) {
        return adminMapper.selectOneByAdminnameAndPasswordAndState(adminname, password, state);
    }

    @Override
    public int updateByPrimaryKeySelective(Admin record) {
        return adminMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Admin record) {
        return adminMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Admin> selectByAdminname(String adminname) {
        return adminMapper.selectByAdminname(adminname);
    }

    @Override
    public List<Admin> selectByTell(String tell) {
        return adminMapper.selectByTell(tell);
    }

    @Override
    public List<Admin> selectByAdminnameAndPassword(String adminname, String password) {
        return adminMapper.selectByAdminnameAndPassword(adminname, password);
    }

    @Override
    public Admin selectOneByAdminnameAndPassword(String adminname, String password) {
        return adminMapper.selectOneByAdminnameAndPassword(adminname, password);
    }

    @Override
    public int updatePhotoById(String updatedPhoto, Integer id) {
        return adminMapper.updatePhotoById(updatedPhoto, id);
    }

    @Override
    public int updatePasswordById(String updatedPassword, Integer id) {
        return adminMapper.updatePasswordById(updatedPassword, id);
    }

    @Override
    public Admin selectOneByAdminnameAndPasswordAndIsadminAndState(String adminname, String password, Integer isadmin, Integer state) {
        return adminMapper.selectOneByAdminnameAndPasswordAndIsadminAndState(adminname, password, isadmin, state);
    }

}



